package com.iflytek.aisol.audit.iflytek.strategy.manage.constant;

import com.fasterxml.jackson.annotation.JsonValue;

public enum ServerType {
    IVE("IveServerConfigs"),
    RIT("RitServerInstances"),
    LLM("LlmServerInstances"),
    RAG("RagServerInstances"),
    SUB("SubServerInstances");

    private final String type;

    ServerType(String type) {
        this.type = type;
    }

    @JsonValue
    public String getType() {
        return type;
    }

    public static ServerType fromType(String type) {
        for (ServerType serverType : ServerType.values()) {
            if (serverType.getType().equalsIgnoreCase(type)) {
                return serverType;
            }
        }
        throw new IllegalArgumentException("Unknown server type: " + type);
    }
}
